<?php
$usuario=$this->session->userdata('logged_in');
$nombre=$usuario['nombre'];
$idPerfil=$usuario['perfil'];

if($idPerfil==PERFIL_ADMINISTRADOR || $idPerfil==PERFIL_RECEPCIONISTA){
    $sideItems =//el sideBar deepende del controllador
    
    array(
        array(
            'label' => 'Nueva',
            'link' => base_url().'cita/reserva_cita',
            'icon'=>'plus',
            'active'=> ($this->uri->segment(2)=="reserva_cita")),
        array(
            'label' => 'Consultar Cita',
            'link' => base_url().'cita/consulta_cita',
            'icon'=>'search',
            'active'=> ($this->uri->segment(2)=="consulta_cita")),
        array(
            'label' => 'Buscar Ordenes',
            'link' => base_url().'cita/consulta_orden',
            'icon'=>'search',
            'active'=> ($this->uri->segment(2)=="consulta_orden")),
        array(
            'label' => 'Confirmar Citas Móviles',
            'link' => base_url().'cita/confirma_cita',
            'icon'=>'search',
            'active'=> ($this->uri->segment(2)=="confirmar_cita"))
    );
    }else if($idPerfil==PERFIL_PACIENTE){
    $sideItems =//el sideBar deepende del controllador
    
    array(
        array(
            'label' => 'Nueva',
            'link' => base_url().'cita/reserva_cita',
            'icon'=>'plus',
            'active'=> ($this->uri->segment(2)=="reserva_cita")),
        );
    }else if($idPerfil==PERFIL_ENFERMERA){
    $sideItems =//el sideBar deepende del controllador
    
    array(
        array(
            'label' => 'Nueva',
            'link' => base_url().'cita/reserva_cita',
            'icon'=>'plus',
            'active'=> ($this->uri->segment(2)=="reserva_cita")),
        );
    }else {
        $sideItems =//el sideBar deepende del controllador
    
    array(
       
        );
    }
?>

<div class="well sidebar-nav">
    <ul class="nav nav-list">
        <li class="nav-header">Citas</li>
        <?php
        foreach ($sideItems as $sideItem){
            $activeStr = "";
            if ($sideItem['active']) $activeStr ="class='active'";
            echo "<li ".$activeStr.">
                        <a href='".$sideItem['link']."'>".
                '<i class="icon-'.$sideItem['icon'].'"></i>'.$sideItem['label'].
                "</a></li>";
        }
        ?>
    </ul>
</div>